package com.zhuss.outer.processor;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.zhuss.bean.vo.outer.outer.DetailOuterAppendVo;
import com.zhuss.exception.ExceptionCode;
import com.zhuss.exception.WpsException;
import com.zhuss.outer.db.dao.ext.OuterAppendDao;


/**
 * 查询外包消息Append processor
 * @Author: zhushanshuo
 * @Date: 2019/9/24 19:54
 */
@Component("outerAppendRead")
public class OuterAppendRead {
	
	@Autowired
	private OuterAppendDao outerAppendDao;
	
	
	public List<DetailOuterAppendVo> listByType(Integer type, Long outerId, Long creatorId) {
		List<DetailOuterAppendVo> list = outerAppendDao.listByType(type, outerId, creatorId);
		return list;
	}
	
	public DetailOuterAppendVo getByType(Integer type, Long outerId, Long creatorId) {
		DetailOuterAppendVo result = outerAppendDao.getByType(type, outerId, creatorId);
		return result;
	}
	
	/**
	 * 外包消息Append详情
	 * @param outerAppendId
	 * @return
	 * @throws WpsException
	 */
	public Object detail(Long outerAppendId) throws WpsException {
		Object result = outerAppendDao.detail(outerAppendId);
		if (result == null) {
			throw new WpsException(ExceptionCode.数据不存在);
		}
		return result;
	}
	
	

}
